<template>
  <div class="box">
    <ul>
      <li v-for="item in list" :key="item.proid" >
        <RouterLink :to="'/details/' + item.proid">
          <img :src="item.img1" alt="" />
          <p>{{ item.proname }}</p>
          <span>￥{{ item.originprice }}</span>
        </RouterLink>
      </li>
    </ul>
  </div>
</template>
<script>
import { gettjlist } from "../../service/user";
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.getlist();
  },
  methods: {
    getlist() {
      gettjlist().then((res) => {
        if (res.data.code === "200") {
          this.list = res.data.data;
        }
      });
    },
    godetails(proid) {},
  },
};
</script>

<style lang="scss" scoped>
.box {
  width: 100%;
  ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    li {
      width: 50%;
      box-sizing: border-box;
      padding: 10px;
      img {
        display: block;
        width: 100%;
      }
      p {
        width: 100%;
        font-size: 17px;
        overflow: hidden;
        height: 40px;
      }
      span {
        color: red;
        font-size: 16px;
      }
    }
  }
}
a{
  color: black;
}
</style>
